package org.example;

import tech.tablesaw.plotly.components.Figure;
import tech.tablesaw.plotly.components.Page;

public class Chart2Html {

    protected static final String DEFAULT_DIV_NAME = "target";


    public static String write(Figure figure) {
        return write(figure, DEFAULT_DIV_NAME);
    }


    public static String write(Figure figure, String divName) {
        Page page = Page.pageBuilder(figure, divName).plotlyJsLocation("./plotly-latest.min.js").build();
        String output = page.asJavascript();
        return output;
    }


}
